import request from '@/utils/request'

// 查询设备信息列表
export function listInfo(query) {
    return request({
        url: '/device/info/list',
        method: 'get',
        params: query
    })
}

// 查询设备信息详细
export function getInfo(deviceId) {
    return request({
        url: '/device/info/getInfo/' + deviceId,
        method: 'get'
    })
}

// 新增设备信息
export function addInfo(data) {
    return request({
        url: '/device/info/add',
        method: 'post',
        data: data
    })
}

// 修改设备信息
export function updateInfo(data) {
    return request({
        url: '/device/info/edit',
        method: 'put',
        data: data
    })
}

// 删除设备信息
export function delInfo(deviceIds) {
    return request({
        url: '/device/info/remove/' + deviceIds,
        method: 'delete'
    })
}

// 设备状态修改
export function changeDeviceStatus(deviceId, deviceStatus) {
    const data = {
        deviceId,
        deviceStatus
    }
    return request({
        url: '/device/info/changeStatus',
        method: 'put',
        data: data
    })
}
